package com.m.demo.mapper;

import com.m.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface ArticleInfoMapper {
    @Select("select * from articleinfo where id = #{articleId}")
    ArticleInfo selectById(Integer articleId);

    @Select("select a.*, u.username, u.age from articleinfo a " +
            "left join user_info u on a.uid = u.id " +
            "where a.id = 1")
    ArticleInfo selectArticleAndUserById(Integer articleId);
}
